package com.lnsf.bookstore.system.userCoupon.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.lnsf.bookstore.system.coupon.dao.CouponMapper;
import com.lnsf.bookstore.system.coupon.vo.Coupon;
import com.lnsf.bookstore.system.userCoupon.dao.UserCouponMapper;
import com.lnsf.bookstore.system.userCoupon.service.UserCouponService;
import com.lnsf.bookstore.system.userCoupon.vo.UserCoupon;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

@Service
public class UserCouponServiceImpl implements UserCouponService {

    @Autowired
    private UserCouponMapper userCouponMapper;

    @Override
    public PageInfo<UserCoupon> queryAll(Map<String, Object> params) {
        PageHelper.startPage(Integer.parseInt(params.get("page").toString()),Integer.parseInt(params.get("limit").toString()));
        return new PageInfo<UserCoupon>(userCouponMapper.selectAll(params));
    }
}
